package bfgca;
import java.util.ArrayList;
import javax.swing.table.AbstractTableModel;

public class PlanetTableModel extends AbstractTableModel{
  private String [] planetColumns = {"Planet Name", "Type", "Occupant" };
  private ArrayList<Object[]> planetEntries = new ArrayList<Object[]>();
  
  public String getColumnName(int col){
    return planetColumns[col].toString();
  }
  public int getRowCount(){
    return planetEntries.size();
  }
  public int getColumnCount(){
    return planetColumns.length;
  }
  public Object getValueAt( int row, int column){
    return planetEntries.get(row)[column];
  }
  public boolean isCellEditable( int row, int column){
    return false;
  }
  private void populateTable(){
    //TODO read data from .json file
    planetEntries.add(new Object[]{"Entry1", "Entry2", "Entry3"});
  }
  public PlanetTableModel(){
    populateTable();
  }

}
